package com.ccp.dev.workflow.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * 对象功能:常用语管理 Model对象
 */
@XmlRootElement(name = "taskApprovalItems")
@XmlAccessorType(XmlAccessType.NONE)
public class TaskApprovalItems extends BaseModel<TaskApprovalItems>{

	/**
	 * 全局
	 */
	public final static Short TYPE_GLOBAL = 1; 
	/**
	 * 对于流程分类
	 */
	public final static Short TYPE_FLOWTYPE = 2; 
	/**
	 * 对于流程
	 */
	public final static Short TYPE_FLOW = 3;
	/**
	 * 对于个人的常用语
	 */
	public final static Short TYPE_USER =4;
	
	/**
	 * 主键
	 */
	@XmlAttribute
	protected String itemId;
	/**
	 * 流程分类ID
	 */
	@XmlAttribute
	protected String typeId;
	/**
	 * 模型Key
	 */
	@XmlAttribute
	protected String modelKey;
	/**
	 * 常用语分类
	 */
	@XmlAttribute
	protected Short type;
	/**
	 * expression
	 */
	@XmlAttribute
	protected String expression;
	/**
	 *  用户ID
	 */
	@XmlAttribute
	protected String userId;

	
	
	
	public String getItemId() {
		return itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	public String getTypeId() {
		return typeId;
	}

	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}



	public String getModelKey() {
		return modelKey;
	}

	public void setModelKey(String modelKey) {
		this.modelKey = modelKey;
	}

	public Short getType() {
		return type;
	}

	public void setType(Short type) {
		this.type = type;
	}

	public String getExpression() {
		return expression;
	}

	public void setExpression(String expression) {
		this.expression = expression;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	/**
	 * @see Object#equals(Object)
	 */
	@Override
	public boolean equals(Object object)
	{
		if (!(object instanceof TaskApprovalItems))
		{
			return false;
		}
		TaskApprovalItems rhs = (TaskApprovalItems) object;
		return new EqualsBuilder()
		.append(this.itemId, rhs.itemId)
		.append(this.type, rhs.type)
		.append(this.modelKey, rhs.modelKey)
		.append(this.typeId, rhs.typeId)
		.append(this.expression, rhs.expression)
		.append(this.userId, rhs.userId)
		.isEquals();
	}

	/**
	 * @see Object#hashCode()
	 */
	@Override
	public int hashCode()
	{
		return new HashCodeBuilder(-82280557, -700257973)
		.append(this.itemId)
		.append(this.type)
		.append(this.modelKey)
		.append(this.typeId)
		.append(this.expression)
		.append(this.userId)
		.toHashCode();
	}

	/**
	 * @see Object#toString()
	 */
	@Override
	public String toString() 
	{
		return new ToStringBuilder(this)
		.append("itemId", this.itemId) 
		.append("type", this.type) 
		.append("modelKey", this.modelKey)
		.append("typeId", this.typeId) 
		.append("expression", this.expression)
		.append("userId",this.userId)
		.toString();
	}
   
  

}